home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 1999 #5 / 1999 CD 5 (black).iso / Delphi3 / install / data.z / IMM.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-08-04  |  25.8 KB  |  588 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Run-time Library                         }
  5. {       Windows 32bit API Interface Unit                }
  6. {                                                       }
  7. {       Copyright (c) 1996,97 Borland International     }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Imm;
  12.  
  13. {$ALIGN ON}
  14. {$MINENUMSIZE 4}
  15. {$WEAKPACKAGEUNIT}
  16.  
  17. interface
  18.  
  19. uses Windows;
  20.  
  21. const
  22.   VK_PROCESSKEY = $E5;
  23.  
  24. type
  25.   HIMC = Integer;
  26.  
  27.   PCompositionForm = ^TCompositionForm;
  28.   TCompositionForm = record
  29.     dwStyle: DWORD;
  30.     ptCurrentPos: TPOINT;
  31.     rcArea: TRECT;
  32.   end;
  33.  
  34.   PCandidateForm = ^TCandidateForm;
  35.   TCandidateForm = record
  36.     dwIndex: DWORD;
  37.     dwStyle: DWORD;
  38.     ptCurrentPos: TPOINT;
  39.     rcArea: TRECT;
  40.   end;
  41.  
  42.   PCandidateList = ^TCandidateList;
  43.   TCandidateList = record
  44.     dwSize: DWORD;
  45.     dwStyle: DWORD;
  46.     dwCount: DWORD;
  47.     dwSelection: DWORD;
  48.     dwPageStart: DWORD;
  49.     dwPageSize: DWORD;
  50.     dwOffset: array[1..1] of DWORD;
  51.   end;
  52.  
  53.   PRegisterWordA = ^TRegisterWordA;
  54.   PRegisterWordW = ^TRegisterWordW;
  55.   PRegisterWord = PRegisterWordA;
  56.   TRegisterWordA = record
  57.     lpReading: PAnsiChar;
  58.     lpWord: PAnsiChar;
  59.   end;
  60.   TRegisterWordW = record
  61.     lpReading: PWideChar;
  62.     lpWord: PWideChar;
  63.   end;
  64.   TRegisterWord = TRegisterWordA;
  65.  
  66. const 
  67.   STYLE_DESCRIPTION_SIZE = 32;
  68.  
  69. type
  70.   PStyleBufA = ^TStyleBufA;
  71.   PStyleBufW = ^TStyleBufW;
  72.   PStyleBuf = PStyleBufA;
  73.   TStyleBufA = record
  74.     dwStyle: DWORD;
  75.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of AnsiChar; 
  76.   end;
  77.   TStyleBufW = record
  78.     dwStyle: DWORD;
  79.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of WideChar; 
  80.   end;
  81.   TStyleBuf = TStyleBufA;
  82.  
  83. { prototype of IMM API }
  84.  
  85. function ImmInstallIMEA(lpszIMEFileName, lpszLayoutText: PAnsiChar): HKL; stdcall;
  86. function ImmInstallIMEW(lpszIMEFileName, lpszLayoutText: PWideChar): HKL; stdcall;
  87. function ImmInstallIME(lpszIMEFileName, lpszLayoutText: PChar): HKL; stdcall;
  88.  
  89. function ImmGetDefaultIMEWnd(hWnd: HWND): HWND; stdcall;
  90.  
  91. function ImmGetDescriptionA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  92. function ImmGetDescriptionW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  93. function ImmGetDescription(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  94.  
  95. function ImmGetIMEFileNameA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  96. function ImmGetIMEFileNameW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  97. function ImmGetIMEFileName(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  98.  
  99. function ImmGetProperty(hKl: HKL; dWord: DWORD): DWORD; stdcall;
  100.  
  101. function ImmIsIME(hKl: HKL): Boolean; stdcall;
  102.  
  103. function ImmSimulateHotKey(hWnd: HWND; dWord: DWORD): Boolean; stdcall;
  104.  
  105. function ImmCreateContext: HIMC; stdcall;
  106. function ImmDestroyContext(hImc: HIMC): Boolean; stdcall;
  107. function ImmGetContext(hWnd: HWND): HIMC; stdcall;
  108. function ImmReleaseContext(hWnd: HWND; hImc: HIMC): Boolean; stdcall;
  109. function ImmAssociateContext(hWnd: HWND; hImc: HIMC): HIMC; stdcall;
  110.  
  111. function ImmGetCompositionStringA(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  112. function ImmGetCompositionStringW(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  113. function ImmGetCompositionString(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  114.  
  115. function ImmSetCompositionStringA(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  116. function ImmSetCompositionStringW(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  117. function ImmSetCompositionString(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  118.  
  119. function ImmGetCandidateListCountA(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  120. function ImmGetCandidateListCountW(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  121. function ImmGetCandidateListCount(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  122.  
  123. function ImmGetCandidateListA(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  124. function ImmGetCandidateListW(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  125. function ImmGetCandidateList(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  126.  
  127. function ImmGetGuideLineA(hImc: HIMC; dwIndex: DWORD; lpBuf: PAnsiChar; dwBufLen: DWORD): DWORD; stdcall;
  128. function ImmGetGuideLineW(hImc: HIMC; dwIndex: DWORD; lpBuf: PWideChar; dwBufLen: DWORD): DWORD; stdcall;
  129. function ImmGetGuideLine(hImc: HIMC; dwIndex: DWORD; lpBuf: PChar; dwBufLen: DWORD): DWORD; stdcall;
  130.  
  131. function ImmGetConversionStatus(hImc: HIMC; var Conversion, Sentence: DWORD): Boolean; stdcall;
  132. function ImmSetConversionStatus(hImc: HIMC; Conversion, Sentence: DWORD): Boolean; stdcall;
  133. function ImmGetOpenStatus(hImc: HIMC): Boolean; stdcall;
  134. function ImmSetOpenStatus(hImc: HIMC; fOpen: Boolean): Boolean; stdcall;
  135.  
  136. function ImmGetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  137. function ImmGetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  138. function ImmGetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  139.  
  140. function ImmSetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  141. function ImmSetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  142. function ImmSetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  143.  
  144. function ImmConfigureIMEA(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  145. function ImmConfigureIMEW(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  146. function ImmConfigureIME(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  147.  
  148. function ImmEscapeA(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  149. function ImmEscapeW(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  150. function ImmEscape(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  151.  
  152. function ImmGetConversionListA(hKl: HKL; hImc: HIMC; lpSrc: PAnsiChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  153. function ImmGetConversionListW(hKl: HKL; hImc: HIMC; lpSrc: PWideChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  154. function ImmGetConversionList(hKl: HKL; hImc: HIMC; lpSrc: PChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  155.  
  156. function ImmNotifyIME(hImc: HIMC; dwAction, dwIndex, dwValue: DWORD): Boolean; stdcall;
  157.  
  158. function ImmGetStatusWindowPos(hImc: HIMC; var lpPoint : TPoint): Boolean; stdcall;
  159. function ImmSetStatusWindowPos(hImc: HIMC; lpPoint: PPOINT): Boolean; stdcall;
  160. function ImmGetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  161. function ImmSetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  162. function ImmGetCandidateWindow(hImc: HIMC; dwBufLen: DWORD; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  163. function ImmSetCandidateWindow(hImc: HIMC; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  164.  
  165. function ImmIsUIMessageA(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  166. function ImmIsUIMessageW(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  167. function ImmIsUIMessage(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  168.  
  169. function ImmGetVirtualKey(hWnd: HWND): UINT; stdcall;
  170.  
  171. type
  172.   RegisterWordEnumProcA = Function(lpReading: PAnsiChar; dwStyle: DWORD; lpszString: PAnsiChar; lpData: pointer): integer;
  173.   RegisterWordEnumProcW = Function(lpReading: PWideChar; dwStyle: DWORD; lpszString: PWideChar; lpData: pointer): integer;
  174.   RegisterWordEnumProc = RegisterWordEnumProcA;
  175.  
  176. function ImmRegisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar): Boolean; stdcall;
  177. function ImmRegisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar): Boolean; stdcall;
  178. function ImmRegisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar): Boolean; stdcall;
  179.  
  180. function ImmUnregisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszUnregister: PAnsiChar): Boolean; stdcall;
  181. function ImmUnregisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszUnregister: PWideChar): Boolean; stdcall;
  182. function ImmUnregisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszUnregister: PChar): Boolean; stdcall;
  183.  
  184. function ImmGetRegisterWordStyleA(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFA): UINT; stdcall;
  185. function ImmGetRegisterWordStyleW(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFW): UINT; stdcall;
  186. function ImmGetRegisterWordStyle(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUF): UINT; stdcall;
  187.  
  188. function ImmEnumRegisterWordA(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCA; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar; lpData : pointer): UINT; stdcall;
  189. function ImmEnumRegisterWordW(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCW; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar; lpData : pointer): UINT; stdcall;
  190. function ImmEnumRegisterWord(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROC; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar; lpData : pointer): UINT; stdcall;
  191.  
  192. const
  193. { the IME related messages  ( removed in 4.0 SDK }
  194.   WM_CONVERTREQUESTEX            = $0108;
  195.   WM_IME_STARTCOMPOSITION        = $010D;
  196.   WM_IME_ENDCOMPOSITION          = $010E;
  197.   WM_IME_COMPOSITION             = $010F;
  198.   WM_IME_KEYLAST                 = $010F;
  199.  
  200.   WM_IME_SETCONTEXT              = $0281;
  201.   WM_IME_NOTIFY                  = $0282;
  202.   WM_IME_CONTROL                 = $0283;
  203.   WM_IME_COMPOSITIONFULL         = $0284;
  204.   WM_IME_SELECT                  = $0285;
  205.   WM_IME_CHAR                    = $0286;
  206.  
  207.   WM_IME_KEYDOWN                 = $0290;
  208.   WM_IME_KEYUP                   = $0291;
  209.  
  210. { wParam for WM_IME_CONTROL }
  211.   IMC_GETCANDIDATEPOS            = $0007;
  212.   IMC_SETCANDIDATEPOS            = $0008;
  213.   IMC_GETCOMPOSITIONFONT         = $0009;
  214.   IMC_SETCOMPOSITIONFONT         = $000A;
  215.   IMC_GETCOMPOSITIONWINDOW       = $000B;
  216.   IMC_SETCOMPOSITIONWINDOW       = $000C;
  217.   IMC_GETSTATUSWINDOWPOS         = $000F;
  218.   IMC_SETSTATUSWINDOWPOS         = $0010;
  219.   IMC_CLOSESTATUSWINDOW          = $0021;
  220.   IMC_OPENSTATUSWINDOW           = $0022;
  221.  
  222. { wParam for WM_IME_CONTROL to the soft keyboard }
  223. { dwAction for ImmNotifyIME }
  224.   NI_OPENCANDIDATE               = $0010;
  225.   NI_CLOSECANDIDATE              = $0011;
  226.   NI_SELECTCANDIDATESTR          = $0012;
  227.   NI_CHANGECANDIDATELIST         = $0013;
  228.   NI_FINALIZECONVERSIONRESULT    = $0014;
  229.   NI_COMPOSITIONSTR              = $0015;
  230.   NI_SETCANDIDATE_PAGESTART      = $0016;
  231.   NI_SETCANDIDATE_PAGESIZE       = $0017;
  232.  
  233. { lParam for WM_IME_SETCONTEXT }
  234.   ISC_SHOWUICANDIDATEWINDOW      = $00000001;
  235.   ISC_SHOWUICOMPOSITIONWINDOW    = $80000000;
  236.   ISC_SHOWUIGUIDELINE            = $40000000;
  237.   ISC_SHOWUIALLCANDIDATEWINDOW   = $0000000F;
  238.   ISC_SHOWUIALL                  = $C000000F;
  239.  
  240. { dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR }
  241.   CPS_COMPLETE                   = $0001;
  242.   CPS_CONVERT                    = $0002;
  243.   CPS_REVERT                     = $0003;
  244.   CPS_CANCEL                     = $0004;
  245.  
  246. { the modifiers of hot key }
  247.   MOD_ALT                        = $0001;
  248.   MOD_CONTROL                    = $0002;
  249.   MOD_SHIFT                      = $0004;
  250.  
  251.   MOD_LEFT                       = $8000;
  252.   MOD_RIGHT                      = $4000;
  253.  
  254.   MOD_ON_KEYUP                   = $0800;
  255.   MOD_IGNORE_ALL_MODIFIER        = $0400;
  256.  
  257. { Windows for Simplified Chinese Edition hot key ID from #10 - #2F }
  258.   IME_CHOTKEY_IME_NONIME_TOGGLE          = $10;
  259.   IME_CHOTKEY_SHAPE_TOGGLE               = $11;
  260.   IME_CHOTKEY_SYMBOL_TOGGLE              = $12;
  261.  
  262. { Windows for Japanese Edition hot key ID from #30 - #4F }
  263.   IME_JHOTKEY_CLOSE_OPEN                 = $30;
  264.  
  265. { Windows for Korean Edition hot key ID from #50 - #6F }
  266.   IME_KHOTKEY_SHAPE_TOGGLE               = $50;
  267.   IME_KHOTKEY_HANJACONVERT               = $51;
  268.   IME_KHOTKEY_ENGLISH                    = $52;
  269.  
  270. { Windows for Tranditional Chinese Edition hot key ID from #70 - #8F }
  271.   IME_THOTKEY_IME_NONIME_TOGGLE          = $70;
  272.   IME_THOTKEY_SHAPE_TOGGLE               = $71;
  273.   IME_THOTKEY_SYMBOL_TOGGLE              = $72;
  274.  
  275. { direct switch hot key ID from #100 - #11F }
  276.   IME_HOTKEY_DSWITCH_FIRST               = $100;
  277.   IME_HOTKEY_DSWITCH_LAST                = $11F;
  278.  
  279. { IME private hot key from #200 - #21F }
  280.   IME_HOTKEY_PRIVATE_FIRST               = $200;
  281.   IME_ITHOTKEY_RESEND_RESULTSTR          = $200;
  282.   IME_ITHOTKEY_PREVIOUS_COMPOSITION      = $201;
  283.   IME_ITHOTKEY_UISTYLE_TOGGLE            = $202;
  284.   IME_HOTKEY_PRIVATE_LAST                = $21F;
  285.  
  286. { parameter of ImmGetCompositionString }
  287.   GCS_COMPREADSTR                = $0001;
  288.   GCS_COMPREADATTR               = $0002;
  289.   GCS_COMPREADCLAUSE             = $0004;
  290.   GCS_COMPSTR                    = $0008;
  291.   GCS_COMPATTR                   = $0010;
  292.   GCS_COMPCLAUSE                 = $0020;
  293.   GCS_CURSORPOS                  = $0080;
  294.   GCS_DELTASTART                 = $0100;
  295.   GCS_RESULTREADSTR              = $0200;
  296.   GCS_RESULTREADCLAUSE           = $0400;
  297.   GCS_RESULTSTR                  = $0800;
  298.   GCS_RESULTCLAUSE               = $1000;
  299.  
  300. { style bit flags for WM_IME_COMPOSITION }
  301.   CS_INSERTCHAR                  = $2000;
  302.   CS_NOMOVECARET                 = $4000;
  303.  
  304. { bits of fdwInit of INPUTCONTEXT }
  305. { IME version constants }
  306.   IMEVER_0310                    = $0003000A;
  307.   IMEVER_0400                    = $00040000;
  308.  
  309. { IME property bits }
  310.   IME_PROP_AT_CARET              = $00010000;
  311.   IME_PROP_SPECIAL_UI            = $00020000;
  312.   IME_PROP_CANDLIST_START_FROM_1 = $00040000;
  313.   IME_PROP_UNICODE               = $00080000;
  314.  
  315. { IME UICapability bits }
  316.   UI_CAP_2700                    = $00000001;
  317.   UI_CAP_ROT90                   = $00000002;
  318.   UI_CAP_ROTANY                  = $00000004;
  319.  
  320. { ImmSetCompositionString Capability bits }
  321.   SCS_CAP_COMPSTR                = $00000001;
  322.   SCS_CAP_MAKEREAD               = $00000002;
  323.  
  324. { IME WM_IME_SELECT inheritance Capability bits }
  325.   SELECT_CAP_CONVERSION          = $00000001;
  326.   SELECT_CAP_SENTENCE            = $00000002;
  327.  
  328. { ID for deIndex of ImmGetGuideLine }
  329.   GGL_LEVEL                      = $00000001;
  330.   GGL_INDEX                      = $00000002;
  331.   GGL_STRING                     = $00000003;
  332.   GGL_PRIVATE                    = $00000004;
  333.  
  334. { ID for dwLevel of GUIDELINE Structure }
  335.   GL_LEVEL_NOGUIDELINE           = $00000000;
  336.   GL_LEVEL_FATAL                 = $00000001;
  337.   GL_LEVEL_ERROR                 = $00000002;
  338.   GL_LEVEL_WARNING               = $00000003;
  339.   GL_LEVEL_INFORMATION           = $00000004;
  340.  
  341. { ID for dwIndex of GUIDELINE Structure }
  342.   GL_ID_UNKNOWN                  = $00000000;
  343.   GL_ID_NOMODULE                 = $00000001;
  344.   GL_ID_NODICTIONARY             = $00000010;
  345.   GL_ID_CANNOTSAVE               = $00000011;
  346.   GL_ID_NOCONVERT                = $00000020;
  347.   GL_ID_TYPINGERROR              = $00000021;
  348.   GL_ID_TOOMANYSTROKE            = $00000022;
  349.   GL_ID_READINGCONFLICT          = $00000023;
  350.   GL_ID_INPUTREADING             = $00000024;
  351.   GL_ID_INPUTRADICAL             = $00000025;
  352.   GL_ID_INPUTCODE                = $00000026;
  353.   GL_ID_INPUTSYMBOL              = $00000027;
  354.   GL_ID_CHOOSECANDIDATE          = $00000028;
  355.   GL_ID_REVERSECONVERSION        = $00000029;
  356.   GL_ID_PRIVATE_FIRST            = $00008000;
  357.   GL_ID_PRIVATE_LAST             = $0000FFFF;
  358.  
  359. { ID for dwIndex of ImmGetProperty }
  360.   IGP_GETIMEVERSION              = 4;
  361.   IGP_PROPERTY                   = $00000004;
  362.   IGP_CONVERSION                 = $00000008;
  363.   IGP_SENTENCE                   = $0000000c;
  364.   IGP_UI                         = $00000010;
  365.   IGP_SETCOMPSTR                 = $00000014;
  366.   IGP_SELECT                     = $00000018;
  367.  
  368. { dwIndex for ImmSetCompositionString API }
  369.   SCS_SETSTR                     = (GCS_COMPREADSTR or GCS_COMPSTR);
  370.   SCS_CHANGEATTR                 = (GCS_COMPREADATTR or GCS_COMPATTR);
  371.   SCS_CHANGECLAUSE               = (GCS_COMPREADCLAUSE or GCS_COMPCLAUSE);
  372.  
  373. { attribute for COMPOSITIONSTRING Structure }
  374.   ATTR_INPUT                     = $00;
  375.   ATTR_TARGET_CONVERTED          = $01;
  376.   ATTR_CONVERTED                 = $02;
  377.   ATTR_TARGET_NOTCONVERTED       = $03;
  378.   ATTR_INPUT_ERROR               = $04;
  379.  
  380. { bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW }
  381.   CFS_DEFAULT                    = $0000;
  382.   CFS_RECT                       = $0001;
  383.   CFS_POINT                      = $0002;
  384.   CFS_SCREEN                     = $0004;    { removed in 4.0 SDK }
  385.   CFS_FORCE_POSITION             = $0020;
  386.   CFS_CANDIDATEPOS               = $0040;
  387.   CFS_EXCLUDE                    = $0080;
  388.  
  389. { conversion direction for ImmGetConversionList }
  390.   GCL_CONVERSION                 = $0001;
  391.   GCL_REVERSECONVERSION          = $0002;
  392.   GCL_REVERSE_LENGTH             = $0003;
  393.  
  394. { bit field for conversion mode }
  395.   IME_CMODE_ALPHANUMERIC         = $0000;
  396.   IME_CMODE_NATIVE               = $0001;
  397.   IME_CMODE_CHINESE              = IME_CMODE_NATIVE;
  398.   IME_CMODE_HANGEUL              = IME_CMODE_NATIVE;
  399.   IME_CMODE_HANGUL               = IME_CMODE_NATIVE;
  400.   IME_CMODE_JAPANESE             = IME_CMODE_NATIVE;
  401.   IME_CMODE_KATAKANA             = $0002;  { effective only under IME_CMODE_NATIVE}
  402.   IME_CMODE_LANGUAGE             = $0003;
  403.   IME_CMODE_FULLSHAPE            = $0008;
  404.   IME_CMODE_ROMAN                = $0010;
  405.   IME_CMODE_CHARCODE             = $0020;
  406.   IME_CMODE_HANJACONVERT         = $0040;
  407.   IME_CMODE_SOFTKBD              = $0080;
  408.   IME_CMODE_NOCONVERSION         = $0100;
  409.   IME_CMODE_EUDC                 = $0200;
  410.   IME_CMODE_SYMBOL               = $0400;
  411.  
  412.   IME_SMODE_NONE                 = $0000;
  413.   IME_SMODE_PLAURALCLAUSE        = $0001;
  414.   IME_SMODE_SINGLECONVERT        = $0002;
  415.   IME_SMODE_AUTOMATIC            = $0004;
  416.   IME_SMODE_PHRASEPREDICT        = $0008;
  417.  
  418. { style of candidate }
  419.   IME_CAND_UNKNOWN               = $0000;
  420.   IME_CAND_READ                  = $0001;
  421.   IME_CAND_CODE                  = $0002;
  422.   IME_CAND_MEANING               = $0003;
  423.   IME_CAND_RADICAL               = $0004;
  424.   IME_CAND_STROKE                = $0005;
  425.  
  426. { wParam of report message WM_IME_NOTIFY }
  427.   IMN_CLOSESTATUSWINDOW          = $0001;
  428.   IMN_OPENSTATUSWINDOW           = $0002;
  429.   IMN_CHANGECANDIDATE            = $0003;
  430.   IMN_CLOSECANDIDATE             = $0004;
  431.   IMN_OPENCANDIDATE              = $0005;
  432.   IMN_SETCONVERSIONMODE          = $0006;
  433.   IMN_SETSENTENCEMODE            = $0007;
  434.   IMN_SETOPENSTATUS              = $0008;
  435.   IMN_SETCANDIDATEPOS            = $0009;
  436.   IMN_SETCOMPOSITIONFONT         = $000A;
  437.   IMN_SETCOMPOSITIONWINDOW       = $000B;
  438.   IMN_SETSTATUSWINDOWPOS         = $000C;
  439.   IMN_GUIDELINE                  = $000D;
  440.   IMN_PRIVATE                    = $000E;
  441.  
  442. { error code of ImmGetCompositionString }
  443.   IMM_ERROR_NODATA               = -1;
  444.   IMM_ERROR_GENERAL              = -2;
  445.  
  446. { dialog mode of ImmConfigureIME }
  447.   IME_CONFIG_GENERAL             = 1;
  448.   IME_CONFIG_REGISTERWORD        = 2;
  449.   IME_CONFIG_SELECTDICTIONARY    = 3;
  450.  
  451. { dialog mode of ImmEscape }
  452.   IME_ESC_QUERY_SUPPORT          = $0003;
  453.   IME_ESC_RESERVED_FIRST         = $0004;
  454.   IME_ESC_RESERVED_LAST          = $07FF;
  455.   IME_ESC_PRIVATE_FIRST          = $0800;
  456.   IME_ESC_PRIVATE_LAST           = $0FFF;
  457.   IME_ESC_SEQUENCE_TO_INTERNAL   = $1001;
  458.   IME_ESC_GET_EUDC_DICTIONARY    = $1003;
  459.   IME_ESC_SET_EUDC_DICTIONARY    = $1004;
  460.   IME_ESC_MAX_KEY                = $1005;
  461.   IME_ESC_IME_NAME               = $1006;
  462.   IME_ESC_SYNC_HOTKEY            = $1007;
  463.   IME_ESC_HANJA_MODE             = $1008;
  464.   IME_ESC_AUTOMATA               = $1009;
  465.  
  466.   IME_ESC_PRIVATE_HOTKEY         = $100A;
  467.   
  468. { style of word registration }
  469.   IME_REGWORD_STYLE_EUDC         = $00000001;
  470.   IME_REGWORD_STYLE_USER_FIRST   = $80000000;
  471.   IME_REGWORD_STYLE_USER_LAST    = $FFFFFFFF;
  472.  
  473. { type of soft keyboard }
  474. { for Windows Tranditional Chinese Edition }
  475.   SOFTKEYBOARD_TYPE_T1           = $0001;
  476. { for Windows Simplified Chinese Edition }
  477.   SOFTKEYBOARD_TYPE_C1           = $0002;
  478.  
  479. const
  480.   imm32 = 'imm32.dll';
  481.  
  482. implementation
  483.  
  484. function ImmInstallIMEA; external imm32 name 'ImmInstallIMEA';
  485. function ImmInstallIMEW; external imm32 name 'ImmInstallIMEW';
  486. function ImmInstallIME; external imm32 name 'ImmInstallIMEA';
  487.  
  488. function ImmGetDefaultIMEWnd; external imm32 name 'ImmGetDefaultIMEWnd';
  489.  
  490. function ImmGetDescriptionA; external imm32 name 'ImmGetDescriptionA';
  491. function ImmGetDescriptionW; external imm32 name 'ImmGetDescriptionW';
  492. function ImmGetDescription; external imm32 name 'ImmGetDescriptionA';
  493.  
  494. function ImmGetIMEFileNameA; external imm32 name 'ImmGetIMEFileNameA';
  495. function ImmGetIMEFileNameW; external imm32 name 'ImmGetIMEFileNameW';
  496. function ImmGetIMEFileName; external imm32 name 'ImmGetIMEFileNameA';
  497.  
  498. function ImmGetProperty; external imm32 name 'ImmGetProperty';
  499.  
  500. function ImmIsIME; external imm32 name 'ImmIsIME';
  501.  
  502. function ImmSimulateHotKey; external imm32 name 'ImmSimulateHotKey';
  503.  
  504. function ImmCreateContext; external imm32 name 'ImmCreateContext';
  505. function ImmDestroyContext; external imm32 name 'ImmDestroyContext';
  506. function ImmGetContext; external imm32 name 'ImmGetContext';
  507. function ImmReleaseContext; external imm32 name 'ImmReleaseContext';
  508. function ImmAssociateContext; external imm32 name 'ImmAssociateContext';
  509.  
  510. function ImmGetCompositionStringA; external imm32 name 'ImmGetCompositionStringA';
  511. function ImmGetCompositionStringW; external imm32 name 'ImmGetCompositionStringW';
  512. function ImmGetCompositionString; external imm32 name 'ImmGetCompositionStringA';
  513.  
  514. function ImmSetCompositionStringA; external imm32 name 'ImmSetCompositionStringA';
  515. function ImmSetCompositionStringW; external imm32 name 'ImmSetCompositionStringW';
  516. function ImmSetCompositionString; external imm32 name 'ImmSetCompositionStringA';
  517.  
  518. function ImmGetCandidateListCountA; external imm32 name 'ImmGetCandidateListCountA';
  519. function ImmGetCandidateListCountW; external imm32 name 'ImmGetCandidateListCountW';
  520. function ImmGetCandidateListCount; external imm32 name 'ImmGetCandidateListCountA';
  521.  
  522. function ImmGetCandidateListA; external imm32 name 'ImmGetCandidateListA';
  523. function ImmGetCandidateListW; external imm32 name 'ImmGetCandidateListW';
  524. function ImmGetCandidateList; external imm32 name 'ImmGetCandidateListA';
  525.  
  526. function ImmGetGuideLineA; external imm32 name 'ImmGetGuideLineA';
  527. function ImmGetGuideLineW; external imm32 name 'ImmGetGuideLineW';
  528. function ImmGetGuideLine; external imm32 name 'ImmGetGuideLineA';
  529.  
  530. function ImmGetConversionStatus; external imm32 name 'ImmGetConversionStatus';
  531. function ImmSetConversionStatus; external imm32 name 'ImmSetConversionStatus';
  532. function ImmGetOpenStatus; external imm32 name 'ImmGetOpenStatus';
  533. function ImmSetOpenStatus; external imm32 name 'ImmSetOpenStatus';
  534.  
  535. function ImmGetCompositionFontA; external imm32 name 'ImmGetCompositionFontA';
  536. function ImmGetCompositionFontW; external imm32 name 'ImmGetCompositionFontW';
  537. function ImmGetCompositionFont; external imm32 name 'ImmGetCompositionFontA';
  538.  
  539. function ImmSetCompositionFontA; external imm32 name 'ImmSetCompositionFontA';
  540. function ImmSetCompositionFontW; external imm32 name 'ImmSetCompositionFontW';
  541. function ImmSetCompositionFont; external imm32 name 'ImmSetCompositionFontA';
  542.  
  543. function ImmConfigureIMEA; external imm32 name 'ImmConfigureIMEA';
  544. function ImmConfigureIMEW; external imm32 name 'ImmConfigureIMEW';
  545. function ImmConfigureIME; external imm32 name 'ImmConfigureIMEA';
  546.  
  547. function ImmEscapeA; external imm32 name 'ImmEscapeA';
  548. function ImmEscapeW; external imm32 name 'ImmEscapeW';
  549. function ImmEscape; external imm32 name 'ImmEscapeA';
  550.  
  551. function ImmGetConversionListA; external imm32 name 'ImmGetConversionListA';
  552. function ImmGetConversionListW; external imm32 name 'ImmGetConversionListW';
  553. function ImmGetConversionList; external imm32 name 'ImmGetConversionListA';
  554.  
  555. function ImmNotifyIME; external imm32 name 'ImmNotifyIME';
  556.  
  557. function ImmGetStatusWindowPos; external imm32 name 'ImmGetStatusWindowPos';
  558. function ImmSetStatusWindowPos; external imm32 name 'ImmSetStatusWindowPos';
  559. function ImmGetCompositionWindow; external imm32 name 'ImmGetCompositionWindow';
  560. function ImmSetCompositionWindow; external imm32 name 'ImmSetCompositionWindow';
  561. function ImmGetCandidateWindow; external imm32 name 'ImmGetCandidateWindow';
  562. function ImmSetCandidateWindow; external imm32 name 'ImmSetCandidateWindow';
  563.  
  564. function ImmIsUIMessageA; external imm32 name 'ImmIsUIMessageA';
  565. function ImmIsUIMessageW; external imm32 name 'ImmIsUIMessageW';
  566. function ImmIsUIMessage; external imm32 name 'ImmIsUIMessageA';
  567.  
  568. function ImmGetVirtualKey; external imm32 name 'ImmGetVirtualKey';
  569.  
  570. function ImmRegisterWordA; external imm32 name 'ImmRegisterWordA';
  571. function ImmRegisterWordW; external imm32 name 'ImmRegisterWordW';
  572. function ImmRegisterWord; external imm32 name 'ImmRegisterWordA';
  573.  
  574. function ImmUnregisterWordA; external imm32 name 'ImmUnregisterWordA';
  575. function ImmUnregisterWordW; external imm32 name 'ImmUnregisterWordW';
  576. function ImmUnregisterWord; external imm32 name 'ImmUnregisterWordA';
  577.  
  578. function ImmGetRegisterWordStyleA; external imm32 name 'ImmGetRegisterWordStyleA';
  579. function ImmGetRegisterWordStyleW; external imm32 name 'ImmGetRegisterWordStyleW';
  580. function ImmGetRegisterWordStyle; external imm32 name 'ImmGetRegisterWordStyleA';
  581.  
  582. function ImmEnumRegisterWordA; external imm32 name 'ImmEnumRegisterWordA';
  583. function ImmEnumRegisterWordW; external imm32 name 'ImmEnumRegisterWordW';
  584. function ImmEnumRegisterWord; external imm32 name 'ImmEnumRegisterWordA';
  585.  
  586. end.
  587.  
  588.